package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import com.huawei.appmarket.framework.widget.ExpandableLayout;
import com.huawei.appmarket.framework.widget.ExpandableLayout.e;
import com.huawei.appmarket.service.store.awk.card.SafeAppCard;
import java.util.ArrayList;
import o.cdr;
import o.djs;
import o.djs.c;
import o.eib;
import o.ewm.h;
import o.ewm.j;

public class SafeAppNode extends cdr {
    private SafeAppCard ˊ;
    private a ॱॱ = new a();
    private boolean ᐝ = true;

    class a implements e {
        final /* synthetic */ SafeAppNode ॱ;

        private a(SafeAppNode safeAppNode) {
            this.ॱ = safeAppNode;
        }

        public void ˋ() {
            for (int i = 0; i < this.ॱ.ˏ(); i++) {
                if (((SafeAppCard) this.ॱ.ˎ(i)).ˊ() != null && this.ॱ.ᐝ) {
                    ((SafeAppCard) this.ॱ.ˎ(i)).ˎ(((SafeAppCard) this.ॱ.ˎ(i)).ˊ());
                }
            }
            this.ॱ.ᐝ = false;
        }
    }

    public SafeAppNode(Context context) {
        super(context, eib.ॱᐝ());
    }

    public int ˏ() {
        return eib.ॱᐝ();
    }

    public void ॱˊ() {
        super.ॱˊ();
    }

    public ArrayList<String> z_() {
        if (this.ˊ == null || this.ˊ.ʼ() == null || !this.ˊ.ॱॱ()) {
            return null;
        }
        return this.ˊ.ʼ().z_();
    }

    public ViewGroup ˊ(LayoutInflater layoutInflater, ViewGroup viewGroup) {
        return (ViewGroup) layoutInflater.inflate(h.ˎͺ, viewGroup);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        int ˏ = ˏ();
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        LinearLayout linearLayout = (LinearLayout) viewGroup.findViewById(j.ˏˏ);
        LayoutParams layoutParams2 = new LinearLayout.LayoutParams(eib.ᐝॱ(), -1);
        View inflate = from.inflate(h.ˊʽ, null);
        ExpandableLayout expandableLayout = (ExpandableLayout) inflate.findViewById(j.ꓸˏ);
        djs o_djs = new djs(ˏ, eib.ॱ(), eib.ˎ());
        c ˊ = o_djs.ˊ();
        ˏ = 0;
        while (true) {
            Rect ˎ = ˊ.ˎ();
            if (ˎ != null) {
                if (ˏ != 0) {
                    linearLayout.addView(new Space(this.ॱ), layoutParams2);
                }
                ˏ++;
                View inflate2 = from.inflate(h.ㆍ, null);
                o_djs.ˋ(inflate2, j.ʻᐝ, ˎ);
                this.ˊ = ॱ(inflate2);
                this.ˊ.ॱ(expandableLayout);
                ˊ(this.ˊ);
                linearLayout.addView(inflate2, layoutParams);
            } else {
                expandableLayout.setOnExpandStatusChangeListener(this.ॱॱ);
                viewGroup.addView(inflate);
                return true;
            }
        }
    }

    public void ˏ(int i) {
        for (int i2 = 0; i2 < ˏ(); i2++) {
            ˎ(i2).ᐝ((ˏ() * i) + i2);
        }
    }

    protected SafeAppCard ॱ(View view) {
        SafeAppCard safeAppCard = new SafeAppCard(this.ॱ);
        safeAppCard.ˏ(view);
        return safeAppCard;
    }

    public cdr ॱॱ() {
        return this.ˊ.ʼ();
    }

    public boolean ʻ() {
        return true;
    }

    public void ॱˎ() {
        super.ॱˎ();
    }
}
